import React, {Fragment} from 'react'
import Taro from '@tarojs/taro'
import {View,Text,Image, ScrollView} from '@tarojs/components'

function HotList ({hotList}){
  function goToCommdetail(item){
    Taro.navigateTo({
      url: '/pages/commdetail/index'
    })
  }
  return (
    <Fragment >
      {
        hotList.map((item,index) => {
          return (
            <View className='hot_list_item' key={index} onClick={() => {goToCommdetail(item)}}>
              <View className='item_fl'>
                <Image src={item.hotImg}></Image>
              </View>
              <View className='item_fr'>
                <Text className='item_fr_tit'>{item.title}</Text>
                <Text className='item_fr_con'>{item.description}</Text>
                <View className='item_fr_boo'>
                  <Text className='new_price'>{item.newPrice}</Text>
                  <Text className='old_price'>{item.oldPrice}</Text>
                </View>
              </View>
            </View>
          )
        })
      }
    </Fragment>
  )
}
export default HotList
